#pragma once

#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
#include <functional>
#include <memory>
#include <mutex>
#include <thread>
#include <typeinfo>
#include <condition_variable>

#include <cassert>
#include <cstring>

#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <sys/timerfd.h>
#include <signal.h>

#include "Log.hpp"
#include "InetAddr.hpp"

using namespace log_ns;

enum
{
    SOCKET_ERROR = 1,
    BIND_ERROR,
    LISTEN_ERROR,

    EPOLL_CREATE_ERROR,

    EVENTFD_CREATE_ERROR,
    EVENTFD_READ_ERROR,
    EVENTFD_WRITE_ERROR,

    TIMERFD_CREATE_ERROR,
    TIMERFD_SETTIME_ERROR,
    TIMERFD_READ_ERROR,
};

class NetWork
{
public:
    NetWork()
    {
        signal(SIGPIPE, SIG_IGN);
    }
};

static NetWork nw;

